package cn.lngaosu.lwyd.module.system.dal.mysql.webinterfacelog;

import java.util.*;

import cn.lngaosu.lwyd.framework.common.pojo.PageResult;
import cn.lngaosu.lwyd.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.lngaosu.lwyd.framework.mybatis.core.mapper.BaseMapperX;
import cn.lngaosu.lwyd.module.system.dal.dataobject.webinterfacelog.WebinterfaceLogDO;
import org.apache.ibatis.annotations.Mapper;
import cn.lngaosu.lwyd.module.system.controller.admin.webinterfacelog.vo.*;

/**
 * 接口数据-请求日志 Mapper
 *
 * @author 张恒
 */
@Mapper
public interface WebinterfaceLogMapper extends BaseMapperX<WebinterfaceLogDO> {

    default PageResult<WebinterfaceLogDO> selectPage(WebinterfaceLogPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<WebinterfaceLogDO>()
                .betweenIfPresent(WebinterfaceLogDO::getCreateTime, reqVO.getCreateTime())
                .likeIfPresent(WebinterfaceLogDO::getInterfaceSystemName, reqVO.getInterfaceSystemName())
                .likeIfPresent(WebinterfaceLogDO::getInterfaceName, reqVO.getInterfaceName())
                .eqIfPresent(WebinterfaceLogDO::getInterfaceUrl, reqVO.getInterfaceUrl())
                .eqIfPresent(WebinterfaceLogDO::getInterfaceRequestMethod, reqVO.getInterfaceRequestMethod())
                .eqIfPresent(WebinterfaceLogDO::getInterfaceParam, reqVO.getInterfaceParam())
                .eqIfPresent(WebinterfaceLogDO::getInterfaceStatus, reqVO.getInterfaceStatus())
                .eqIfPresent(WebinterfaceLogDO::getInterfaceErrorInfo, reqVO.getInterfaceErrorInfo())
                .orderByDesc(WebinterfaceLogDO::getId));
    }

}